package com.kenyi.co.common.ui;


import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.umeng.analytics.MobclickAgent;


public class BaseActivity extends AppCompatActivity {
    protected Context mContext;
    public String uid, key;


    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        mContext = this;


        try {
            String calssname = this.getClass().getName();
            String[] classstr = calssname.split("\\.");
            String calssnamenew = classstr[classstr.length - 2] + "0" + classstr[classstr.length - 1];
            Log.e("TAG", calssnamenew);
            MobclickAgent.onEvent(this, calssnamenew);
        } catch (Exception e) {
            Log.e("TAG", e.toString());
        }
    }

    /**
     * 友盟统计
     */
    @Override
    public void onResume() {
        super.onResume();

        MobclickAgent.onResume(this);

    }

    @Override
    public void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);

    }


    @Override
    public Resources getResources() {
        Resources res = super.getResources();
        Configuration config = new Configuration();
        config.setToDefaults();
        res.updateConfiguration(config, res.getDisplayMetrics());
        return res;
    }

}
